<template>
<fieldset>
    <legend>缓存组件</legend>
    <button @click="dynamic='tab1'">tab1</button>
    <button @click="dynamic='tab2'">tab2</button>
    <button @click="dynamic='tab3'">tab3</button>
    <keepAlive :include="['tab2','tab3']">
        <h1 :is="dynamic"></h1>
    </keepAlive>
</fieldset>
</template>
<script>
import Tab from "../Tab"
export default{
    data(){
        return{
            dynamic:""
        }
    },
    components: {
    "tab1":Tab,
    "tab2":Tab,
    "tab3":Tab,
}  
    }

</script>